\(\int \frac {1}{\sqrt {x} (-a+b x)} \, dx\) [472]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 29 \[ \int \frac {1}{\sqrt {x} (-a+b x)} \, dx=-\frac {2 \text {arctanh}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b}} \]

[Out]

-2*arctanh(b^(1/2)*x^(1/2)/a^(1/2))/a^(1/2)/b^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {65, 214} \[ \int \frac {1}{\sqrt {x} (-a+b x)} \, dx=-\frac {2 \text {arctanh}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b}} \]

[In]

Int[1/(Sqrt[x]*(-a + b*x)),x]

[Out]

(-2*ArcTanh[(Sqrt[b]*Sqrt[x])/Sqrt[a]])/(Sqrt[a]*Sqrt[b])

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rubi steps \begin{align*} \text {integral}& = 2 \text {Subst}\left (\int \frac {1}{-a+b x^2} \, dx,x,\sqrt {x}\right ) \\ & = -\frac {2 \tanh ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.00 \[ \int \frac {1}{\sqrt {x} (-a+b x)} \, dx=-\frac {2 \text {arctanh}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b}} \]

[In]

Integrate[1/(Sqrt[x]*(-a + b*x)),x]

[Out]

(-2*ArcTanh[(Sqrt[b]*Sqrt[x])/Sqrt[a]])/(Sqrt[a]*Sqrt[b])

Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.66

method result size
derivativedivides \(-\frac {2 \,\operatorname {arctanh}\left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{\sqrt {a b}}\) \(19\)
default \(-\frac {2 \,\operatorname {arctanh}\left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{\sqrt {a b}}\) \(19\)

[In]

int(1/(b*x-a)/x^(1/2),x,method=_RETURNVERBOSE)

[Out]

-2/(a*b)^(1/2)*arctanh(b*x^(1/2)/(a*b)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 67, normalized size of antiderivative = 2.31 \[ \int \frac {1}{\sqrt {x} (-a+b x)} \, dx=\left [\frac {\sqrt {a b} \log \left (\frac {b x + a - 2 \, \sqrt {a b} \sqrt {x}}{b x - a}\right )}{a b}, \frac {2 \, \sqrt {-a b} \arctan \left (\frac {\sqrt {-a b}}{b \sqrt {x}}\right )}{a b}\right ] \]

[In]

integrate(1/(b*x-a)/x^(1/2),x, algorithm="fricas")

[Out]

[sqrt(a*b)*log((b*x + a - 2*sqrt(a*b)*sqrt(x))/(b*x - a))/(a*b), 2*sqrt(-a*b)*arctan(sqrt(-a*b)/(b*sqrt(x)))/(
a*b)]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 68 vs. \(2 (29) = 58\).

Time = 0.53 (sec) , antiderivative size = 68, normalized size of antiderivative = 2.34 \[ \int \frac {1}{\sqrt {x} (-a+b x)} \, dx=\begin {cases} \frac {\tilde {\infty }}{\sqrt {x}} & \text {for}\: a = 0 \wedge b = 0 \\- \frac {2 \sqrt {x}}{a} & \text {for}\: b = 0 \\- \frac {2}{b \sqrt {x}} & \text {for}\: a = 0 \\\frac {\log {\left (\sqrt {x} - \sqrt {\frac {a}{b}} \right )}}{b \sqrt {\frac {a}{b}}} - \frac {\log {\left (\sqrt {x} + \sqrt {\frac {a}{b}} \right )}}{b \sqrt {\frac {a}{b}}} & \text {otherwise} \end {cases} \]

[In]

integrate(1/(b*x-a)/x**(1/2),x)

[Out]

Piecewise((zoo/sqrt(x), Eq(a, 0) & Eq(b, 0)), (-2*sqrt(x)/a, Eq(b, 0)), (-2/(b*sqrt(x)), Eq(a, 0)), (log(sqrt(
x) - sqrt(a/b))/(b*sqrt(a/b)) - log(sqrt(x) + sqrt(a/b))/(b*sqrt(a/b)), True))

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.17 \[ \int \frac {1}{\sqrt {x} (-a+b x)} \, dx=\frac {\log \left (\frac {b \sqrt {x} - \sqrt {a b}}{b \sqrt {x} + \sqrt {a b}}\right )}{\sqrt {a b}} \]

[In]

integrate(1/(b*x-a)/x^(1/2),x, algorithm="maxima")

[Out]

log((b*sqrt(x) - sqrt(a*b))/(b*sqrt(x) + sqrt(a*b)))/sqrt(a*b)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.69 \[ \int \frac {1}{\sqrt {x} (-a+b x)} \, dx=\frac {2 \, \arctan \left (\frac {b \sqrt {x}}{\sqrt {-a b}}\right )}{\sqrt {-a b}} \]

[In]

integrate(1/(b*x-a)/x^(1/2),x, algorithm="giac")

[Out]

2*arctan(b*sqrt(x)/sqrt(-a*b))/sqrt(-a*b)

Mupad [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.66 \[ \int \frac {1}{\sqrt {x} (-a+b x)} \, dx=-\frac {2\,\mathrm {atanh}\left (\frac {\sqrt {b}\,\sqrt {x}}{\sqrt {a}}\right )}{\sqrt {a}\,\sqrt {b}} \]

[In]

int(-1/(x^(1/2)*(a - b*x)),x)

[Out]

-(2*atanh((b^(1/2)*x^(1/2))/a^(1/2)))/(a^(1/2)*b^(1/2))